//
// Created by bleedingfight on 2020/6/28.
//
#include "inorderTraversal.h"
void inorderTraversal(TreeNode* root, std::vector<int>& result) {
  if (!root)
    return;
  else {
    if (root->left) inorderTraversal(root->left, result);
    result.push_back(root->val);
    if (root->right) inorderTraversal(root->right, result);
  }
}
std::vector<int> inorderTraversal(TreeNode* root) {
  std::vector<int> result = std::vector<int>();
  inorderTraversal(root, result);
  return result;
}
